<template>
  <!-- 右上角时间 -->
  <div class="clock">
    <div class="digit years">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit years">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit years">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit years">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="separator date"></div>
    <div class="digit months">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit months">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="separator date"></div>
    <div class="digit dates">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit dates">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="nbsp"></div>
    <div class="digit hours">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit hours">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="separator time">
      <div></div>
      <div></div>
    </div>
    <div class="digit minutes">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit minutes">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="separator time">
      <div></div>
      <div></div>
    </div>
    <div class="digit seconds">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
    <div class="digit seconds">
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
      <div class="segment"></div>
    </div>
  </div>
</template>

<script>
import timeClock from "../../public/js/digital-clock";
export default {
  name: "TimeClock",
  mounted() {
    // 引用时间滚动器
    timeClock();
  },
};
</script>

<style lang="less" scoped>
.clock {
  height: 200px;
  width: 100%;
  zoom: 0.13;
  display: flex;
  align-items: center;
}
.digit {
  width: 120px;
  height: 200px;
  margin: 0 5px;
  position: relative;
  display: inline-block;
}
.digit .segment {
  background: #15fdfa;
  border-radius: 5px;
  position: absolute;
  opacity: 0.05;
  transition: opacity 0.2s;
  -webkit-transition: opacity 0.2s;
  -ms-transition: opacity 0.2s;
  -moz-transition: opacity 0.2s;
  -o-transition: opacity 0.2s;
}
.digit .segment.on,
.separator {
  opacity: 1;
  box-shadow: 0 0 50px rgba(21, 253, 250, 0.702);
  transition: opacity 0s;
  -webkit-transition: opacity 0s;
  -ms-transition: opacity 0s;
  -moz-transition: opacity 0s;
  -o-transition: opacity 0s;
}
.separator.date {
  width: 60px;
  height: 200px;
  display: inline-block;
  margin: 0 15px;
  border-top: 2px solid #15fdfa;
  box-shadow: none;
  transform: translateY(50%);
}
.separator.time {
  width: 80px;
  height: 200px;
  margin: 0 15px;
  box-shadow: none;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  > div {
    width: 30px;
    height: 30px;
    background: #15fdfa;
    border-radius: 50%;
  }
}
.nbsp {
  display: inline-block;
  width: 100px;
}
.digit .segment:nth-child(1) {
  top: 10px;
  left: 20px;
  right: 20px;
  height: 20px;
}
.digit .segment:nth-child(2) {
  top: 20px;
  right: 10px;
  width: 20px;
  height: 75px;
  height: calc(50% - 25px);
}
.digit .segment:nth-child(3) {
  bottom: 20px;
  right: 10px;
  width: 20px;
  height: 75px;
  height: calc(50% - 25px);
}
.digit .segment:nth-child(4) {
  bottom: 10px;
  right: 20px;
  height: 20px;
  left: 20px;
}
.digit .segment:nth-child(5) {
  bottom: 20px;
  left: 10px;
  width: 20px;
  height: 75px;
  height: calc(50% - 25px);
}
.digit .segment:nth-child(6) {
  top: 20px;
  left: 10px;
  width: 20px;
  height: 75px;
  height: calc(50% - 25px);
}
.digit .segment:nth-child(7) {
  bottom: 95px;
  bottom: calc(50% - 5px);
  right: 20px;
  left: 20px;
  height: 20px;
}
</style>